home *** CD-ROM | disk | FTP | other *** search
/ BCI NET / BCI NET Dec 94.iso / archives / programming / blitzbasic / blitz-list200994.lha / blitz-list / 000394_blitz-list-request_Wed May 18 13:46:31 1994.msg < prev    next >
Internet Message Format  |  1994-09-20  |  3KB

  1. Received: from mailsun.aber.ac.uk (mailsun.aber.ac.uk [144.124.16.7]) by kantti.helsinki.fi (8.6.9/8.6.5) with SMTP id NAA09116 for <blitz-list@helsinki.fi>; Wed, 18 May 1994 13:46:14 +0300
  2. Received: from athene.dcs.aber.ac.uk by mailsun.aber.ac.uk with SMTP (PP);
  3.           Wed, 18 May 1994 11:45:49 +0100
  4. Received: from thorbb by athene.dcs.aber.ac.uk (4.1/aberclient-4.0-cs-1.1) 
  5.           id AA08844; Wed, 18 May 94 11:45:17 BST
  6. To: s924723@minyos.xx.rmit.edu.au (Son Huu Le)
  7. Cc: blitz-list@helsinki.fi, nlh1@aber.ac.uk
  8. Subject: Re: Reading volume name
  9. In-Reply-To: Your message of "Tue, 17 May 1994 21:31:01 +1000." <9405171131.12355@minyos.xx.rmit.EDU.AU>
  10. Date: Wed, 18 May 1994 11:45:36 +0100
  11. Message-Id: <22200.769257936@mailhost.aber.ac.uk>
  12. From: Nigel Hughes <nlh1@aber.ac.uk>
  13. X-Status: 
  14. Status: RO
  15.  
  16. In message <9405171131.12355@minyos.xx.rmit.EDU.AU>, 
  17.     s924723@minyos.xx.rmit.EDU.AU (Son Huu Le) writes:
  18. > > Hi guys,
  19. > >  OK I have a bit of a problem, I want to check all disk drives for a file
  20. > > in their root. So I need all the volume names, easy I say I will just get
  21. > > a DosList from dosextens. So I knock up this routine, compiles fine, I get
  22. > > all type 2's (Volumes) and the correct number of them, however when I try
  23. > > and get the BPTR to the BSTR I get negative values, zeros and when I try
  24. > > and look at the BSTR I get garbage, even if I get a valid address! Why?
  25. > ARRRGGGHHHH!!! This almost drove me crazy!! (;
  26.  
  27. No pun intended, I hope 8)
  28.  
  29. Thanks man, I was begining to think I was the only one on this list that tries
  30. to do things that are not listed in the manuals!
  31.  
  32.  
  33. > The problem was a combination of wrong DosList structure and wrong
  34. > interpretation of BSTR.
  35.  
  36. Ah ha.
  37.  
  38. > Firstly, the DosList should contain a C union of three different structures
  39. > (ie. DosListUnion should be either dol_Handler, dol_Volume or dol_AssignList,
  40. > not all three!) The .dt_Volume newtype provides a workaround.
  41.  
  42. OK I am being stupid.
  43.  
  44. > Secondly, a BSTR is a BPTR with the first byte containing string length.
  45. > To convert a BPTR to a normal Amiga pointer you must multiply it by 4.
  46. > ie. APTR = BPTR << 2
  47.  
  48. Yeah, I did try that and still got crap, must have been doing something wrong, again 8)
  49. Ho hum.
  50.  
  51. > Thirdly, you've got a weird way of accessing newtype structures. (;
  52.  
  53. Yep, but I types this in from memory when I got here, as I forgot my source 8)
  54.  
  55. > Okay, here is the working version.
  56.  
  57. You're a champ.
  58.  
  59. Nigel Hughes...